//
//  JHMacros.h
//  shengxian
//
//  Created by 杨笑 on 2016/10/19.
//  Copyright © 2016年 杨笑. All rights reserved.
//

#ifndef JHMacros_h
#define JHMacros_h

//屏幕宽度与高度
//#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 // 当前Xcode支持iOS8及以上
//#define SCREEN_WIDTH ([[UIScreen mainScreen] respondsToSelector:@selector(nativeBounds)]?[UIScreen mainScreen].nativeBounds.size.width/[UIScreen mainScreen].nativeScale:[UIScreen mainScreen].bounds.size.width)
//#define SCREENH_HEIGHT ([[UIScreen mainScreen] respondsToSelector:@selector(nativeBounds)]?[UIScreen mainScreen].nativeBounds.size.height/[UIScreen mainScreen].nativeScale:[UIScreen mainScreen].bounds.size.height)
//#define SCREEN_SIZE ([[UIScreen mainScreen] respondsToSelector:@selector(nativeBounds)]?CGSizeMake([UIScreen mainScreen].nativeBounds.size.width/[UIScreen mainScreen].nativeScale,[UIScreen mainScreen].nativeBounds.size.height/[UIScreen mainScreen].nativeScale):[UIScreen mainScreen].bounds.size)
//#else
#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREENH_HEIGHT [UIScreen mainScreen].bounds.size.height
#define SCREEN_SIZE [UIScreen mainScreen].bounds.size
//#endif



//日志输出宏定义
#ifdef DEBUG
//调试状态
#define NSLog(FORMAT, ...) fprintf(stderr,"%s:%d\t%s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);

#else
//发布状态
#define NSLog(...)

#endif

#import "UIView+extension.h"
#import "Masonry.h"
#import "Tool+PsychologicalCounselling.h"
#import "MBProgressHUD+Category.h"


//APP版本号
#define kAppVersion [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
//系统版本号
#define kSystemVersion [[UIDevice currentDevice] systemVersion]
//获取当前语言
#define kCurrentLanguage ([[NSLocale preferredLanguages] objectAtIndex:0])
#define kBundleIdentifier [[NSBundle mainBundle]bundleIdentifier]

#define  IPHONE4S                SCREENH_HEIGHT == 480
#define  IPHONE6P                SCREEN_WIDTH == 414
#define  IPHONE6                 SCREEN_WIDTH == 375
#define  IPHONE5S                SCREENH_HEIGHT == 568

//弱引用／强饮用
#define WeakSelf(type)  __weak typeof(type) weak##type = type;
#define StrongSelf(type)  __strong typeof(type) type = weak##type;

typedef void(^ButtonActionBlock)(id obj);
typedef void(^ButtonActionIndexBlock)(id obj,int index);
#define kToken                          @"token"
#define kMobile                         @"mobile"
#define kAnnouncementTimestamp          @"AnnouncementTimestamp"

//配置信息
#define kConsultantTitle                @"ConsultantTitle"
#define kHospitalTitle                  @"HospitalTitle"
#define kSkilledfieldTitle              @"SkilledfieldTitle"

#define RENMINGBI @"¥"

#define kLoginNotification              @"LoginNotification"
#define kLogOutNotification             @"LogOutNotification"
#define kMobileChangeNotification       @"MobileChangeNotification"
#define kAppDidBecomeActive             @"AppDidBecomeActive"
#define kCustomMessageSendNotification  @"CustomMessageSendNotification"

#define kCode(dictionary)  [dictionary[@"code"] intValue] == 0
#define kWangLuoLianJieBuChang [MBProgressHUD showError:@"网络连接不畅"];
#define kShowError(dictionary) [MBProgressHUD showError:dictionary[@"message"]];


#define kAppCachesPath [NSString stringWithFormat:@"%@/Library/Caches/",NSHomeDirectory()]
#define kIsOpenRemotePush              @"IsOpenRemotePush"

//颜色转换
#define COLOR_WITH_HEX(hexValue) [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16)) / 255.0 green:((float)((hexValue & 0xFF00) >> 8)) / 255.0 blue:((float)(hexValue & 0xFF)) / 255.0 alpha:1.0f]
#define COLOR_WITH_HEX_ALPHA(hexValue,alp) [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16)) / 255.0 green:((float)((hexValue & 0xFF00) >> 8)) / 255.0 blue:((float)(hexValue & 0xFF)) / 255.0 alpha:alp]

#define COLOR(R,G,B) [UIColor colorWithRed: (R) / 255.0 green: (G) / 255.0 blue: (B) / 255.0 alpha:1.0]
#endif /* JHMacros_h */

#define kFDD416       [@"fdd416" colorWithHexString]
#define kFF002A       [@"ff002a" colorWithHexString]
#define k333333       [@"333333" colorWithHexString]
#define k666666       [@"666666" colorWithHexString]
#define k999999       [@"999999" colorWithHexString]
#define kF2F2F2       [@"f2f2f2" colorWithHexString]   //背景色
#define kF1F1F1       [@"f1f1f1" colorWithHexString]
#define kCCCCCC       [@"CCCCCC" colorWithHexString]   //line颜色
#define kF6F6F6       [@"f6f6f6" colorWithHexString]
#define k2DDAC4       [@"2DDAC4" colorWithHexString]
#define k65ACFE       [@"65acfe" colorWithHexString]   //主题蓝
/*
//httpRequestheader token头
#define kBearer @"Bearer"

//hotKey
#define kHotKey @"HotKey"


//用户信息
#define kUserName               @"username"
#define kUserKeychainService    @"userKeychainService"

#define kUserId                 @"userId"


//ip地址
//#define SERVER_ADDRESS        @"";//PRO
//#define SERVER_ADDRESS        @"http://api.jiahe365.com/"   //DEV 内测
#define SERVER_ADDRESS        @"http://api.jiahe365.cn/"   //DEV 开发

//七牛上传 处理图片大小后缀
#define QiNiuSuffixWithImageWidth(width)  [NSString stringWithFormat:@"?imageView2/2/q/100/w/%.0f",width*2]

//NSNotification
#define kUserAvatarUpdateNotification @"UserAvatarUpdateNotification" //用户头像更新
#define kPayResponseNotification      @"PayResponseNotification"      //支付回调
*/




